#include "cpputility.h"

wchar_t* my_multibyte_to_widebyte(char* multiStr)
{
	int dwSize;
	dwSize = MultiByteToWideChar(CP_ACP, 0, multiStr, -1, NULL, 0);
	wchar_t* wideStr;
	wideStr = (wchar_t*)malloc(dwSize*2);
	MultiByteToWideChar(CP_ACP, 0, multiStr, -1, wideStr, dwSize);
	return wideStr;
}


char* my_widechar_to_multibyte(wchar_t* p_wstr)
{
	int i_mul_size;
	char* p_mul_char;
	BOOL b_use_default = FALSE;
	i_mul_size = WideCharToMultiByte(CP_ACP, 0, p_wstr, -1, NULL, 0, NULL, &b_use_default) + 1;

	p_mul_char = (char*)malloc(i_mul_size);

	WideCharToMultiByte(CP_ACP, 0, p_wstr, -1, p_mul_char, i_mul_size, NULL, &b_use_default);

	return p_mul_char;
}
